using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Security.Cryptography;
using System.Text;

public class DataFile
{
	public class SaveHelper
	{
		public static byte[] RijndaelEncrypt(byte[] toEncryptArray, string pKey)
		{
			byte[] bytes = Encoding.UTF8.GetBytes(pKey);
			return new RijndaelManaged
			{
				Key = bytes,
				Mode = CipherMode.ECB,
				Padding = PaddingMode.PKCS7
			}.CreateEncryptor().TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
		}

		public static byte[] RijndaelDecrypt(byte[] toEncryptArray, string pKey)
		{
			byte[] bytes = Encoding.UTF8.GetBytes(pKey);
			return new RijndaelManaged
			{
				Key = bytes,
				Mode = CipherMode.ECB,
				Padding = PaddingMode.PKCS7
			}.CreateDecryptor().TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
		}

		private static string RijndaelDecrypt(string pString, string pKey)
		{
			byte[] bytes = Encoding.UTF8.GetBytes(pKey);
			byte[] array = Convert.FromBase64String(pString);
			byte[] bytes2 = new RijndaelManaged
			{
				Key = bytes,
				Mode = CipherMode.ECB,
				Padding = PaddingMode.PKCS7
			}.CreateDecryptor().TransformFinalBlock(array, 0, array.Length);
			return Encoding.UTF8.GetString(bytes2);
		}

		private static object DeserializeObject(string pString, Type pType)
		{
			return JsonConvert.DeserializeObject(pString, pType);
		}

		public static object _oldGetData(string fileName, Type pType)
		{
			StreamReader streamReader = File.OpenText(fileName);
			string pString = RijndaelDecrypt(streamReader.ReadToEnd(), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
			streamReader.Close();
			return DeserializeObject(pString, pType);
		}

		private static string RijndaelEncrypt(string pString, string pKey)
		{
			byte[] bytes = Encoding.UTF8.GetBytes(pKey);
			byte[] bytes2 = Encoding.UTF8.GetBytes(pString);
			byte[] array = new RijndaelManaged
			{
				Key = bytes,
				Mode = CipherMode.ECB,
				Padding = PaddingMode.PKCS7
			}.CreateEncryptor().TransformFinalBlock(bytes2, 0, bytes2.Length);
			return Convert.ToBase64String(array, 0, array.Length);
		}

		private static string SerializeObject(object pObject)
		{
			return JsonConvert.SerializeObject(pObject);
		}

		public static void _oldSetData(string fileName, object pObject)
		{
			new Stopwatch().Start();
			string pString = SerializeObject(pObject);
			pString = RijndaelEncrypt(pString, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
			StreamWriter streamWriter = File.CreateText(fileName);
			streamWriter.Write(pString);
			streamWriter.Flush();
			streamWriter.Close();
		}

		public static byte[] Save(Dictionary<int, Dictionary<int, List<int>>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18779);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, Dictionary<int, List<int>>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, Dictionary<int, List<int>>> dictData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			dictData = new Dictionary<int, Dictionary<int, List<int>>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out Dictionary<int, List<int>> listData);
				dictData.Add(key, listData);
			}
		}

		public static byte[] Save(Dictionary<int, List<int>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, List<int>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, List<int>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, List<int>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out List<int> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, string> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, string> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(dictDatum.Value);
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, string> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, string>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				string value = br.ReadString();
				listData.Add(key, value);
			}
		}

		public static byte[] Save(Dictionary<int, int> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, int> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(dictDatum.Value);
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, int> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, int>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				int value = br.ReadInt32();
				listData.Add(key, value);
			}
		}

		public static byte[] Save(Dictionary<int, int[]> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1229536324);
			binaryWriter.Write((ushort)8283);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, int[]> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, int[]> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, int[]>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out int[] listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(SortedDictionary<int, int[]> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1229536324);
			binaryWriter.Write((ushort)8283);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, int[]> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out SortedDictionary<int, int[]> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new SortedDictionary<int, int[]>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out int[] listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(SortedDictionary<int, List<int>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, List<int>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out SortedDictionary<int, List<int>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new SortedDictionary<int, List<int>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out List<int> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, Dictionary<int, int[]>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, Dictionary<int, int[]>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, Dictionary<int, int[]>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, Dictionary<int, int[]>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out Dictionary<int, int[]> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, SortedDictionary<int, int[]>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, SortedDictionary<int, int[]>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, SortedDictionary<int, int[]>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, SortedDictionary<int, int[]>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out SortedDictionary<int, int[]> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, Dictionary<int, string>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, Dictionary<int, string>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, Dictionary<int, string>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, Dictionary<int, string>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out Dictionary<int, string> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, Dictionary<int, int>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, Dictionary<int, int>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, Dictionary<int, int>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, Dictionary<int, int>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out Dictionary<int, int> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, Dictionary<int, List<int[]>>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, Dictionary<int, List<int[]>>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, Dictionary<int, List<int[]>>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, Dictionary<int, List<int[]>>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out Dictionary<int, List<int[]>> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, Dictionary<int, Dictionary<int, int>>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, Dictionary<int, Dictionary<int, int>>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, Dictionary<int, Dictionary<int, int>>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, Dictionary<int, Dictionary<int, int>>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out Dictionary<int, Dictionary<int, int>> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, Dictionary<int, Dictionary<int, List<int>>>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, Dictionary<int, Dictionary<int, List<int>>>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, Dictionary<int, Dictionary<int, List<int>>>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, Dictionary<int, Dictionary<int, List<int>>>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out Dictionary<int, Dictionary<int, List<int>>> dictData);
				listData.Add(key, dictData);
			}
		}

		public static byte[] Save(Dictionary<int, Dictionary<int, Dictionary<int, List<int[]>>>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, Dictionary<int, Dictionary<int, List<int[]>>>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, Dictionary<int, Dictionary<int, List<int[]>>>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, Dictionary<int, Dictionary<int, List<int[]>>>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out Dictionary<int, Dictionary<int, List<int[]>>> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, Dictionary<int, Dictionary<int, List<string[]>>>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, Dictionary<int, Dictionary<int, List<string[]>>>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, Dictionary<int, Dictionary<int, List<string[]>>>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, Dictionary<int, Dictionary<int, List<string[]>>>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out Dictionary<int, Dictionary<int, List<string[]>>> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, List<string[]>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, List<string[]>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, List<string[]>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, List<string[]>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out List<string[]> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, Dictionary<int, List<string[]>>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18748);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, Dictionary<int, List<string[]>>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, Dictionary<int, List<string[]>>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, Dictionary<int, List<string[]>>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out Dictionary<int, List<string[]>> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(Dictionary<int, List<int[]>> dictData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1279867972);
			binaryWriter.Write((ushort)18779);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(dictData.Count);
			foreach (KeyValuePair<int, List<int[]>> dictDatum in dictData)
			{
				binaryWriter.Write(dictDatum.Key);
				binaryWriter.Write(Save(dictDatum.Value));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out Dictionary<int, List<int[]>> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new Dictionary<int, List<int[]>>();
			for (int i = 0; i < num; i++)
			{
				int key = br.ReadInt32();
				Load(br, out List<int[]> listData2);
				listData.Add(key, listData2);
			}
		}

		public static byte[] Save(List<int[]> listData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1533623372);
			binaryWriter.Write((ushort)15965);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(listData.Count);
			foreach (int[] listDatum in listData)
			{
				binaryWriter.Write(Save(listDatum));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out List<int[]> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new List<int[]>();
			for (int i = 0; i < num; i++)
			{
				Load(br, out int[] listData2);
				listData.Add(listData2);
			}
		}

		public static byte[] Save(List<string[]> listData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1533623372);
			binaryWriter.Write((ushort)15965);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(listData.Count);
			foreach (string[] listDatum in listData)
			{
				binaryWriter.Write(Save(listDatum));
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out List<string[]> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new List<string[]>();
			for (int i = 0; i < num; i++)
			{
				Load(br, out string[] listData2);
				listData.Add(listData2);
			}
		}

		public static byte[] Save(int[] listData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1534357097);
			binaryWriter.Write((ushort)93);
			binaryWriter.Write((ushort)1);
			if (listData == null)
			{
				listData = new int[0];
			}
			binaryWriter.Write(listData.Length);
			int[] array = listData;
			foreach (int value in array)
			{
				binaryWriter.Write(value);
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static byte[] Save(List<int> listData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1534357097);
			binaryWriter.Write((ushort)93);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(listData.Count);
			foreach (int listDatum in listData)
			{
				binaryWriter.Write(listDatum);
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out int[] listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new int[num];
			for (int i = 0; i < num; i++)
			{
				listData[i] = br.ReadInt32();
			}
		}

		public static void Load(BinaryReader br, out List<int> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new List<int>();
			for (int i = 0; i < num; i++)
			{
				listData.Add(br.ReadInt32());
			}
		}

		public static byte[] Save(List<string> listData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1534357097);
			binaryWriter.Write((ushort)93);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(listData.Count);
			foreach (string listDatum in listData)
			{
				binaryWriter.Write(listDatum);
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out List<string> listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new List<string>();
			for (int i = 0; i < num; i++)
			{
				listData.Add(br.ReadString());
			}
		}

		public static byte[] Save(string[] listData)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1534357097);
			binaryWriter.Write((ushort)93);
			binaryWriter.Write((ushort)1);
			if (listData == null)
			{
				listData = new string[0];
			}
			binaryWriter.Write(listData.Length);
			string[] array = listData;
			foreach (string value in array)
			{
				binaryWriter.Write(value);
			}
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		public static void Load(BinaryReader br, out string[] listData)
		{
			br.ReadInt32();
			br.ReadUInt16();
			br.ReadUInt16();
			int num = br.ReadInt32();
			listData = new string[num];
			for (int i = 0; i < num; i++)
			{
				listData[i] = br.ReadString();
			}
		}

		public static void Load(BinaryReader br, out int listData)
		{
			listData = br.ReadInt32();
		}

		public static void Load(BinaryReader br, out string listData)
		{
			listData = br.ReadString();
		}

		public static void Load(BinaryReader br, out ushort listData)
		{
			listData = br.ReadUInt16();
		}

		public static void Load(BinaryReader br, out bool listData)
		{
			listData = br.ReadBoolean();
		}
	}

	public class SaveData
	{
		public int _year;

		public int _samsara;

		public int _mianActorId;

		public string _mainActorName;

		public string _playTime;

		public string _playerSeatName;

		public int _gameLine;

		public int _randSeedValue;

		public int _taiWuShop;

		public int _worldXXLevel;

		public int _homeFavorAdd;

		public Dictionary<int, Dictionary<int, int[]>> _foodUPList;

		public Dictionary<int, Dictionary<int, int[]>> _woodUPList;

		public Dictionary<int, Dictionary<int, int[]>> _stoneUPList;

		public Dictionary<int, Dictionary<int, int[]>> _silkUPList;

		public Dictionary<int, Dictionary<int, int[]>> _herbalUPList;

		public Dictionary<int, Dictionary<int, int[]>> _moneyUPList;

		public Dictionary<int, Dictionary<int, int[]>> _manpowerUseList;

		public Dictionary<int, Dictionary<int, Dictionary<int, int>>> _manpowerHomeUseList;

		public Dictionary<int, Dictionary<int, Dictionary<int, int>>> _manpowerHomeUpList;

		public Dictionary<int, Dictionary<int, Dictionary<int, int>>> _manpowerHomeRemoveList;

		public Dictionary<int, Dictionary<int, int[]>> _backManpowerList;

        [JsonProperty("_baseWorldDate")]
		public Dictionary<int, Dictionary<int, int[]>> _baseWorldData;

        [JsonProperty("_gangDate")]
        public Dictionary<int, Dictionary<int, string>> _gangData;

        [JsonProperty("_gangDate")]
        public Dictionary<int, Dictionary<int, Dictionary<int, List<int>>>> _gangGroupData;

		[JsonProperty("_baseHomeDate")]public Dictionary<int, Dictionary<int, int>> _baseHomeData;

		[JsonProperty("_homeShopBootysDate")]public Dictionary<int, Dictionary<int, Dictionary<int, List<int[]>>>> _homeShopBootysData;

		[JsonProperty("_homeShopSaveMassagesDate")]public Dictionary<int, Dictionary<int, Dictionary<int, List<string[]>>>> _homeShopSaveMassagesData;

		[JsonProperty("_itemsDate")]public Dictionary<int, Dictionary<int, string>> _itemsData;

		[JsonProperty("_actorItemsDate")] public Dictionary<int, Dictionary<int, int>> _actorItemsData;

		[JsonProperty("_actorBookDate")]public Dictionary<int, List<int>> _actorBookData;

		[JsonProperty("_actorShopDate")]public Dictionary<int, Dictionary<int, int>> _actorShopData;

		[JsonProperty("_itemsChangeDate")]public Dictionary<int, Dictionary<int, int>> _itemsChangeData;

		public List<int> _lateDeleteItems;

		[JsonProperty("_actorsDate")]public Dictionary<int, Dictionary<int, string>> _actorsData;

		[JsonProperty("_actorSocialDate")]public SortedDictionary<int, List<int>> _actorSocialData;

		public List<int> _deadActors;

		[JsonProperty("_acotrTeamDate")]public List<int> _acotrTeamData;

		[JsonProperty("_actorFamilyDate")]public List<int> _actorFamilyData;

		[JsonProperty("_actorsWorkingDate")]public Dictionary<int, Dictionary<int, Dictionary<int, int>>> _actorsWorkingData;

		[JsonProperty("_actorStudyDate")]public Dictionary<int, List<int[]>> _actorStudyData;

		public SortedDictionary<int, int[]> _actorSkills;

		public Dictionary<int, SortedDictionary<int, int[]>> _actorGongFas;

		public Dictionary<int, Dictionary<int, int[]>> _actorEquipGongFas;

		public Dictionary<int, Dictionary<int, int[]>> _mianActorEquipGongFas;

		[JsonProperty("_actorInjuryDate")]public Dictionary<int, Dictionary<int, int>> _actorInjuryData;

		public Dictionary<int, List<int>> _actorTalkFavor;

		public Dictionary<int, int[]> _gongFaBookPages;

		public Dictionary<int, int[]> _skillBookPages;

		[JsonProperty("_cricketBoxDate")]public Dictionary<int, int[]> _cricketBoxData;

		public List<int[]> _eventId;

		public int[] _storyShopLevel;

		public int[] _storyShopMoney;

		public List<int> _xxPartIds;

		public List<int> _xxEnemyAtPlace;

		[JsonProperty("_missionDate")]public SortedDictionary<int, int[]> _missionData;

		public Dictionary<int, int[]> _xxPointValue;

		public List<int> _xxList;

		public List<int> _runEnemys;

		public Dictionary<int, Dictionary<int, List<int[]>>> _actorGetScore;

		public int _mianActorEquipGongFaIndex;

		public int _addSkillStudyValue;

		public int _addGongFaStudyValue;

		public int _dayTime;

		public int _dayTrun;

		public int _gongFaExperienceP;

		public int _newItemId;

		public int _newActorId;

		public int _worldId;

		public int _partId;

		public int _placeId;

		public int _buyStudyValue;

		public int _getQuquTrun;

		public string _killActorName;

		public int _xxComeTyp;

		public bool _makePower;

		public bool _readPower;

		public bool _mapHealing1;

		public bool _mapHealing2;

		public int[] _nameIndex;

		public Dictionary<int, List<int>> _endNameIndex;

		public Dictionary<int, List<int>> _badPlaceIds;

		public void FillData()
		{
			_foodUPList = new Dictionary<int, Dictionary<int, int[]>>();
			_woodUPList = new Dictionary<int, Dictionary<int, int[]>>();
			_stoneUPList = new Dictionary<int, Dictionary<int, int[]>>();
			_silkUPList = new Dictionary<int, Dictionary<int, int[]>>();
			_herbalUPList = new Dictionary<int, Dictionary<int, int[]>>();
			_moneyUPList = new Dictionary<int, Dictionary<int, int[]>>();
			_manpowerUseList = new Dictionary<int, Dictionary<int, int[]>>();
			_manpowerHomeUseList = new Dictionary<int, Dictionary<int, Dictionary<int, int>>>();
			_manpowerHomeUpList = new Dictionary<int, Dictionary<int, Dictionary<int, int>>>();
			_manpowerHomeRemoveList = new Dictionary<int, Dictionary<int, Dictionary<int, int>>>();
			_backManpowerList = new Dictionary<int, Dictionary<int, int[]>>();
			_baseWorldData = new Dictionary<int, Dictionary<int, int[]>>();
			_gangData = new Dictionary<int, Dictionary<int, string>>();
			_gangGroupData = new Dictionary<int, Dictionary<int, Dictionary<int, List<int>>>>();
			_baseHomeData = new Dictionary<int, Dictionary<int, int>>();
			_homeShopBootysData = new Dictionary<int, Dictionary<int, Dictionary<int, List<int[]>>>>();
			_homeShopSaveMassagesData = new Dictionary<int, Dictionary<int, Dictionary<int, List<string[]>>>>();
			_itemsData = new Dictionary<int, Dictionary<int, string>>();
			_actorItemsData = new Dictionary<int, Dictionary<int, int>>();
			_actorBookData = new Dictionary<int, List<int>>();
			_actorShopData = new Dictionary<int, Dictionary<int, int>>();
			_itemsChangeData = new Dictionary<int, Dictionary<int, int>>();
			_lateDeleteItems = new List<int>();
			_actorsData = new Dictionary<int, Dictionary<int, string>>();
			_actorSocialData = new SortedDictionary<int, List<int>>();
			_deadActors = new List<int>();
			_acotrTeamData = new List<int>();
			_actorFamilyData = new List<int>();
			_actorsWorkingData = new Dictionary<int, Dictionary<int, Dictionary<int, int>>>();
			_actorStudyData = new Dictionary<int, List<int[]>>();
			_actorSkills = new SortedDictionary<int, int[]>();
			_actorGongFas = new Dictionary<int, SortedDictionary<int, int[]>>();
			_actorEquipGongFas = new Dictionary<int, Dictionary<int, int[]>>();
			_mianActorEquipGongFas = new Dictionary<int, Dictionary<int, int[]>>();
			_actorInjuryData = new Dictionary<int, Dictionary<int, int>>();
			_actorTalkFavor = new Dictionary<int, List<int>>();
			_gongFaBookPages = new Dictionary<int, int[]>();
			_skillBookPages = new Dictionary<int, int[]>();
			_cricketBoxData = new Dictionary<int, int[]>();
			_eventId = new List<int[]>();
			_xxPartIds = new List<int>();
			_xxEnemyAtPlace = new List<int>();
			_missionData = new SortedDictionary<int, int[]>();
			_xxPointValue = new Dictionary<int, int[]>();
			_xxList = new List<int>();
			_runEnemys = new List<int>();
			_actorGetScore = new Dictionary<int, Dictionary<int, List<int[]>>>();
			_endNameIndex = new Dictionary<int, List<int>>();
			_badPlaceIds = new Dictionary<int, List<int>>();
		}

		private void LoadV1(BinaryReader br)
		{
			SaveHelper.Load(br, out _year);
			SaveHelper.Load(br, out _samsara);
			SaveHelper.Load(br, out _mianActorId);
			SaveHelper.Load(br, out _mainActorName);
			SaveHelper.Load(br, out _playTime);
			SaveHelper.Load(br, out _playerSeatName);
			SaveHelper.Load(br, out _gameLine);
			SaveHelper.Load(br, out _randSeedValue);
			SaveHelper.Load(br, out _taiWuShop);
			SaveHelper.Load(br, out _worldXXLevel);
			SaveHelper.Load(br, out _homeFavorAdd);
			SaveHelper.Load(br, out _foodUPList);
			SaveHelper.Load(br, out _woodUPList);
			SaveHelper.Load(br, out _stoneUPList);
			SaveHelper.Load(br, out _silkUPList);
			SaveHelper.Load(br, out _herbalUPList);
			SaveHelper.Load(br, out _moneyUPList);
			SaveHelper.Load(br, out _manpowerUseList);
			SaveHelper.Load(br, out _manpowerHomeUseList);
			SaveHelper.Load(br, out _manpowerHomeUpList);
			SaveHelper.Load(br, out _manpowerHomeRemoveList);
			SaveHelper.Load(br, out _backManpowerList);
			SaveHelper.Load(br, out _baseWorldData);
			SaveHelper.Load(br, out _gangData);
			SaveHelper.Load(br, out _gangGroupData);
			SaveHelper.Load(br, out _baseHomeData);
			SaveHelper.Load(br, out _homeShopBootysData);
			SaveHelper.Load(br, out _homeShopSaveMassagesData);
			SaveHelper.Load(br, out _itemsData);
			SaveHelper.Load(br, out _actorItemsData);
			SaveHelper.Load(br, out _actorBookData);
			SaveHelper.Load(br, out _actorShopData);
			SaveHelper.Load(br, out _itemsChangeData);
			SaveHelper.Load(br, out _lateDeleteItems);
			SaveHelper.Load(br, out _actorsData);
			SaveHelper.Load(br, out _actorSocialData);
			SaveHelper.Load(br, out _deadActors);
			SaveHelper.Load(br, out _acotrTeamData);
			SaveHelper.Load(br, out _actorFamilyData);
			SaveHelper.Load(br, out _actorsWorkingData);
			SaveHelper.Load(br, out _actorStudyData);
			SaveHelper.Load(br, out _actorSkills);
			SaveHelper.Load(br, out _actorGongFas);
			SaveHelper.Load(br, out _actorEquipGongFas);
			SaveHelper.Load(br, out _mianActorEquipGongFas);
			SaveHelper.Load(br, out _actorInjuryData);
			SaveHelper.Load(br, out _actorTalkFavor);
			SaveHelper.Load(br, out _gongFaBookPages);
			SaveHelper.Load(br, out _skillBookPages);
			SaveHelper.Load(br, out _cricketBoxData);
			SaveHelper.Load(br, out _eventId);
			SaveHelper.Load(br, out _storyShopLevel);
			SaveHelper.Load(br, out _storyShopMoney);
			SaveHelper.Load(br, out _xxPartIds);
			SaveHelper.Load(br, out _xxEnemyAtPlace);
			SaveHelper.Load(br, out _missionData);
			SaveHelper.Load(br, out _xxPointValue);
			SaveHelper.Load(br, out _xxList);
			SaveHelper.Load(br, out _runEnemys);
			SaveHelper.Load(br, out _actorGetScore);
			SaveHelper.Load(br, out _mianActorEquipGongFaIndex);
			SaveHelper.Load(br, out _addSkillStudyValue);
			SaveHelper.Load(br, out _addGongFaStudyValue);
			SaveHelper.Load(br, out _dayTime);
			SaveHelper.Load(br, out _dayTrun);
			SaveHelper.Load(br, out _gongFaExperienceP);
			SaveHelper.Load(br, out _newItemId);
			SaveHelper.Load(br, out _newActorId);
			SaveHelper.Load(br, out _worldId);
			SaveHelper.Load(br, out _partId);
			SaveHelper.Load(br, out _placeId);
			SaveHelper.Load(br, out _buyStudyValue);
			SaveHelper.Load(br, out _getQuquTrun);
			SaveHelper.Load(br, out _killActorName);
			SaveHelper.Load(br, out _xxComeTyp);
			SaveHelper.Load(br, out _makePower);
			SaveHelper.Load(br, out _readPower);
			SaveHelper.Load(br, out _mapHealing1);
			SaveHelper.Load(br, out _mapHealing2);
			SaveHelper.Load(br, out _nameIndex);
			SaveHelper.Load(br, out _endNameIndex);
			SaveHelper.Load(br, out _badPlaceIds);
		}

		public void Load(byte[] fileData)
		{
			BinaryReader binaryReader = new BinaryReader(new MemoryStream(fileData));
			binaryReader.BaseStream.Position = 6L;
			if (binaryReader.ReadUInt16() != 1)
			{
				throw new Exception("存档损坏");
			}
			LoadV1(binaryReader);
			binaryReader.Close();
		}

		public byte[] SaveV1()
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1095005023);
			binaryWriter.Write((ushort)16724);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(_year);
			binaryWriter.Write(_samsara);
			binaryWriter.Write(_mianActorId);
			binaryWriter.Write(_mainActorName);
			binaryWriter.Write(_playTime);
			binaryWriter.Write(_playerSeatName);
			binaryWriter.Write(_gameLine);
			binaryWriter.Write(_randSeedValue);
			binaryWriter.Write(_taiWuShop);
			binaryWriter.Write(_worldXXLevel);
			binaryWriter.Write(_homeFavorAdd);
			binaryWriter.Write(SaveHelper.Save(_foodUPList));
			binaryWriter.Write(SaveHelper.Save(_woodUPList));
			binaryWriter.Write(SaveHelper.Save(_stoneUPList));
			binaryWriter.Write(SaveHelper.Save(_silkUPList));
			binaryWriter.Write(SaveHelper.Save(_herbalUPList));
			binaryWriter.Write(SaveHelper.Save(_moneyUPList));
			binaryWriter.Write(SaveHelper.Save(_manpowerUseList));
			binaryWriter.Write(SaveHelper.Save(_manpowerHomeUseList));
			binaryWriter.Write(SaveHelper.Save(_manpowerHomeUpList));
			binaryWriter.Write(SaveHelper.Save(_manpowerHomeRemoveList));
			binaryWriter.Write(SaveHelper.Save(_backManpowerList));
			binaryWriter.Write(SaveHelper.Save(_baseWorldData));
			binaryWriter.Write(SaveHelper.Save(_gangData));
			binaryWriter.Write(SaveHelper.Save(_gangGroupData));
			binaryWriter.Write(SaveHelper.Save(_baseHomeData));
			binaryWriter.Write(SaveHelper.Save(_homeShopBootysData));
			binaryWriter.Write(SaveHelper.Save(_homeShopSaveMassagesData));
			binaryWriter.Write(SaveHelper.Save(_itemsData));
			binaryWriter.Write(SaveHelper.Save(_actorItemsData));
			binaryWriter.Write(SaveHelper.Save(_actorBookData));
			binaryWriter.Write(SaveHelper.Save(_actorShopData));
			binaryWriter.Write(SaveHelper.Save(_itemsChangeData));
			binaryWriter.Write(SaveHelper.Save(_lateDeleteItems));
			binaryWriter.Write(SaveHelper.Save(_actorsData));
			binaryWriter.Write(SaveHelper.Save(_actorSocialData));
			binaryWriter.Write(SaveHelper.Save(_deadActors));
			binaryWriter.Write(SaveHelper.Save(_acotrTeamData));
			binaryWriter.Write(SaveHelper.Save(_actorFamilyData));
			binaryWriter.Write(SaveHelper.Save(_actorsWorkingData));
			binaryWriter.Write(SaveHelper.Save(_actorStudyData));
			binaryWriter.Write(SaveHelper.Save(_actorSkills));
			binaryWriter.Write(SaveHelper.Save(_actorGongFas));
			binaryWriter.Write(SaveHelper.Save(_actorEquipGongFas));
			binaryWriter.Write(SaveHelper.Save(_mianActorEquipGongFas));
			binaryWriter.Write(SaveHelper.Save(_actorInjuryData));
			binaryWriter.Write(SaveHelper.Save(_actorTalkFavor));
			binaryWriter.Write(SaveHelper.Save(_gongFaBookPages));
			binaryWriter.Write(SaveHelper.Save(_skillBookPages));
			binaryWriter.Write(SaveHelper.Save(_cricketBoxData));
			binaryWriter.Write(SaveHelper.Save(_eventId));
			binaryWriter.Write(SaveHelper.Save(_storyShopLevel));
			binaryWriter.Write(SaveHelper.Save(_storyShopMoney));
			binaryWriter.Write(SaveHelper.Save(_xxPartIds));
			binaryWriter.Write(SaveHelper.Save(_xxEnemyAtPlace));
			binaryWriter.Write(SaveHelper.Save(_missionData));
			binaryWriter.Write(SaveHelper.Save(_xxPointValue));
			binaryWriter.Write(SaveHelper.Save(_xxList));
			binaryWriter.Write(SaveHelper.Save(_runEnemys));
			binaryWriter.Write(SaveHelper.Save(_actorGetScore));
			binaryWriter.Write(_mianActorEquipGongFaIndex);
			binaryWriter.Write(_addSkillStudyValue);
			binaryWriter.Write(_addGongFaStudyValue);
			binaryWriter.Write(_dayTime);
			binaryWriter.Write(_dayTrun);
			binaryWriter.Write(_gongFaExperienceP);
			binaryWriter.Write(_newItemId);
			binaryWriter.Write(_newActorId);
			binaryWriter.Write(_worldId);
			binaryWriter.Write(_partId);
			binaryWriter.Write(_placeId);
			binaryWriter.Write(_buyStudyValue);
			binaryWriter.Write(_getQuquTrun);
			binaryWriter.Write(_killActorName);
			binaryWriter.Write(_xxComeTyp);
			binaryWriter.Write(_makePower);
			binaryWriter.Write(_readPower);
			binaryWriter.Write(_mapHealing1);
			binaryWriter.Write(_mapHealing2);
			binaryWriter.Write(SaveHelper.Save(_nameIndex));
			binaryWriter.Write(SaveHelper.Save(_endNameIndex));
			binaryWriter.Write(SaveHelper.Save(_badPlaceIds));
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}
	}

	public class HomeBuildingData
	{
        [JsonProperty(PropertyName = "_homeBuildingsDate")]
		public Dictionary<int, Dictionary<int, Dictionary<int, int[]>>> _homeBuildingsData = new Dictionary<int, Dictionary<int, Dictionary<int, int[]>>>();
	}

	public class GameSetting
	{
		public int _homeTypId;

		public int _ageTime;

		public int _enemyBorn;

		public int _enemySize;

		public int _xxLevel;

		public int _worldResource;

		public int _randomHeir;

		public int _birthWorldId;

		public void FillData()
		{
		}
	}

	public class ActorLife
	{
		public Dictionary<int, Dictionary<int, List<int>>> _actorLife;

		public Dictionary<int, List<int[]>> _actorLifeMassage;

		public void FillData()
		{
			_actorLife = new Dictionary<int, Dictionary<int, List<int>>>();
			_actorLifeMassage = new Dictionary<int, List<int[]>>();
		}

		public byte[] SaveV1()
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			binaryWriter.Write(1766613343);
			binaryWriter.Write((ushort)26213);
			binaryWriter.Write((ushort)1);
			binaryWriter.Write(SaveHelper.Save(_actorLife));
			binaryWriter.Write(SaveHelper.Save(_actorLifeMassage));
			binaryWriter.Flush();
			byte[] result = memoryStream.ToArray();
			binaryWriter.Close();
			return result;
		}

		private void LoadV1(BinaryReader br)
		{
			SaveHelper.Load(br, out _actorLife);
			SaveHelper.Load(br, out _actorLifeMassage);
		}

		public void Load(byte[] fileData)
		{
			BinaryReader binaryReader = new BinaryReader(new MemoryStream(fileData));
			binaryReader.BaseStream.Position = 6L;
			if (binaryReader.ReadUInt16() != 1)
			{
				throw new Exception("存档损坏");
			}
			LoadV1(binaryReader);
			binaryReader.Close();
		}
	}
}
